package com.cgy.utils.spider.adaptor;

import com.cgy.utils.spider.callback.AbstractCallBack;
import com.cgy.utils.spider.config.AbstractConfig;

/**
 *  用于处理启动配置
 * @author CH
 *
 */
public abstract class AbstractAdaptor {
	
	/*{
		System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
		System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
		System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httclient", "info");
	}*/
	
	/**
	 * 设置基础配置
	 * @param config
	 * @return
	 */
	public abstract AbstractAdaptor setConfig(AbstractConfig config);
	
	/**
	 * 异步运行
	 * @param url
	 * @return
	 */
	public abstract void run(String... url);
	/**
	 * 同步运行
	 * @param url
	 * @return
	 */
	public abstract void runAsync(String... url);
	
	/**
	 * 停止运行
	 * @return
	 */
	public abstract void stop();

	/**
	 *  回调
	 * @return
	 */
	public abstract AbstractAdaptor callback(AbstractCallBack abstractCallBack);
}
